package com.raymond.sys.controller;


import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.raymond.sys.entity.SysUser;
import com.raymond.sys.service.ISysUserService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 操作员表 前端控制器
 * </p>
 *
 * @author raymond
 * @since 2019-11-22
 */
@RestController
@RequestMapping("/sys")
public class SysUserController {
    private ISysUserService sysUserService;

    public SysUserController(ISysUserService sysUserService) {
        this.sysUserService = sysUserService;
    }

    @RequestMapping("/getUser")
    public SysUser getUser(){
        Page<SysUser> page = new Page<>(1, 1);
        IPage<SysUser> page1 = sysUserService.page(page);
        System.out.println("分页查询:" + JSONObject.toJSONString(page1));
        return sysUserService.getUser();
//        return page1.getRecords().get(0);
    }
}
